package cn.peng.stu4teach.pages.todo;

import android.view.View;

import androidx.databinding.library.baseAdapters.BR;
import androidx.lifecycle.ViewModelProvider;

import cn.peng.stu4teach.R;
import cn.peng.stu4teach.databinding.FmTodoBinding;
import cn.peng.stu4teach.util.base.BaseFragment;

/**
 * 待办
 * A simple {@link BaseFragment} subclass.
 * Use the {@link TodoFragment#newInstance} factory method to create an instance of this fragment.
 */
public class TodoFragment extends BaseFragment<FmTodoBinding, TodoFmVm> {
    private TodoFragment () {
    }

    public static TodoFragment newInstance () {
        return new TodoFragment();
    }

    @Override
    public int seLayoutId () {
        return R.layout.fm_todo;
    }

    @Override
    public int setBrVmId () {
        return BR.vm;
    }

    @Override
    public TodoFmVm setBrVm () {
        return new ViewModelProvider(this).get(TodoFmVm.class);
    }

    @Override
    public void initData () {
        super.initData();

        mVm.init();
        mVm.initRv(mBinding.rvTodo);
        mVm.initRefreshLayoutEvent(mBinding.refreshLayout);
    }
}